/*  1:   */ package nl.siegmann.epublib.utilities;
/*  2:   */ 
/*  3:   */ public class NumberSayer
/*  4:   */ {
/*  5: 5 */   private static final String[] NUMBER_BELOW_20 = { "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "nineteen" };
/*  6: 6 */   private static final String[] DECIMALS = { "zero", "ten", "twenty", "thirty", "fourty", "fifty", "sixty", "seventy", "eighty", "ninety" };
/*  7: 7 */   private static final String[] ORDER_NUMBERS = { "hundred", "thousand", "million", "billion", "trillion" };
/*  8:   */   
/*  9:   */   public static String getNumberName(int number)
/* 10:   */   {
/* 11:11 */     if (number < 0) {
/* 12:12 */       throw new IllegalArgumentException("Cannot handle numbers < 0 or > 2147483647");
/* 13:   */     }
/* 14:14 */     if (number < 20) {
/* 15:15 */       return NUMBER_BELOW_20[number];
/* 16:   */     }
/* 17:17 */     if (number < 100) {
/* 18:18 */       return DECIMALS[(number / 10)] + NUMBER_BELOW_20[(number % 10)];
/* 19:   */     }
/* 20:20 */     if ((number >= 100) && (number < 200)) {
/* 21:21 */       return ORDER_NUMBERS[0] + getNumberName(number - 100);
/* 22:   */     }
/* 23:23 */     if (number < 1000) {
/* 24:24 */       return NUMBER_BELOW_20[(number / 100)] + ORDER_NUMBERS[0] + getNumberName(number % 100);
/* 25:   */     }
/* 26:26 */     throw new IllegalArgumentException("Cannot handle numbers < 0 or > 2147483647");
/* 27:   */   }
/* 28:   */ }


/* Location:           C:\Users\David\workspace\CosaRaraPorqueSi\main\epublib-tools-3.1.jar
 * Qualified Name:     nl.siegmann.epublib.utilities.NumberSayer
 * JD-Core Version:    0.7.0.1
 */